﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _22_Bridge.Phone
{
    /*手机软件*/
    abstract class HandsetSoft
    {
        public abstract void Run();
    }

    /*手机游戏*/
    class HandsetGame : HandsetSoft
    {
        public override void Run()
        {
            Console.WriteLine("运行手机游戏");
        }
    }

    //手机通讯录
    class HandsetAddressList : HandsetSoft
    {
        public override void Run()
        {
            Console.WriteLine("运行手机通讯录");
        }
    }

    /**************************************/

    /*
     手机品牌
         */
    abstract class HandsetBrand
    {
        //聚合的的软件
        protected HandsetSoft soft;
        public void SetHandSetSoft(HandsetSoft soft)
        {
            this.soft = soft;
        }
        public abstract void Run();
    }

    /*
     * 手机品牌N
     */
    class HandsetBrandN : HandsetBrand
    {
        public override void Run()
        {
            soft.Run();
        }
    }

    /*
     手机品牌M
         */
    class HandsetBrandM : HandsetBrand
    {
        public override void Run()
        {
            soft.Run();
        }
    }
}
